const Koa   = require('koa')

const Roter = require('koa-router')

const http = require('http')

const {Server} = require('socket.io')


const app = new Koa()

const router = new Roter()


const server = http.createServer(app.callback());
const io = new Server(server,{
    cors:{
        origin:'*'
    }
})


io.on('connection', (socket)=>{
    console.log('a user connected');
    const ids = [1,2,3,4,5]
    const data1 = [750,50,750,775,789]
    const data2 = [785,456,452,462,851]
    const data3 = [245,562,751,321,456]
    const data4 = [124,123,124,125,126]
    const data5 = [245,125,63,52,563]
    socket.emit('connection',{message:'a user connected'});
    function updateids(array){
        for(let i=0; i<ids.length; i++){
            array[i] = array[i]+1
        }
      }
})